﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YasharEl.Infrastructure.ExceptionHandling
{
    public class DisabledExceptionHandlingManager : IExceptionManager
    {
        #region IExceptionManager Members

        public bool HandleException(Exception exceptionToHandle, string policyName, out Exception exceptionToThrow)
        {
            exceptionToThrow = exceptionToHandle;
            return true;
        }

        public bool HandleException(Exception exceptionToHandle, string policyName)
        {
            return true;
        }

        public void Process(Action action, string policyName)
        {
            // no op
        }

        public TResult Process<TResult>(Func<TResult> action, TResult defaultResult, string policyName)
        {
            // no op
            return defaultResult;
        }

        #endregion
    }
}
